<?php
require_once '../config/config.php';
$conn = new mysqli(HOST, USER, PASSWORD, DATABASE);
if ($conn->connect_errno) {
    die('数据库连接失败' . $conn->connect_error);
}
$stmt = $conn->prepare('select * from banner_list');
$stmt->execute();
$stmt->bind_result($id,$src,$time,$url);
?>
<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title>幻灯管理界面</title>
    </head>
    <body>
        <h1>幻灯管理</h1>
        <p><a href="banneradd.html">增加</a></p>
        <table>
            <thead>
                <tr>
                    <th>id</th>
                    <th>src</th>
                    <th>time</th>
                    <th>url</th>
                </tr>
            </thead>
            <tbody><?php
       while($stmt->fetch()){
        ?> 
                <tr>
                    <td><?php echo $id;?></td>
                    <td><a target="blank" href="<?php echo $src;?>">点击查看图片</a></td>
                    <td><?php echo date('y-m-d h:i:s',$time)?></td>
                    <td><a target="blank" href="<?php echo $url;?>">链接地址</a><a target="blank" href="bannerupdate.php?id=<?php echo $id;?>">修改链接地址</a></td>
                    <td><a class="delete" href="bannerdel.php?id=<?php echo $id;?>&src=<?php echo $src;?>" >删除</a></td>
                </tr>
                 <?php
       }
       ?>
            </tbody>
        </table>
        <script src="../js/jquery.min.js" type="text/javascript"></script>
        <script src="../js/bannerselect.js" type="text/javascript"></script>
        
    </body>
</html>
